<?php

namespace app\api\controller;

use app\api\logic\page\Home as HomeLogic;
use app\api\logic\page\Article as ArticleLogic;
use app\api\logic\page\Author as AuthorLogic;
use app\api\logic\page\Search as SearchLogic;
use app\api\logic\page\Book as BookLogic;

class Page
{
    use \app\common\traits\Controller;

    public function __construct(
        HomeLogic $homeLogic,
        ArticleLogic $articleLogic,
        AuthorLogic $authorLogic,
        SearchLogic $searchLogic,
        BookLogic $bookLogic
    )
    {
        $this->homeLogic = $homeLogic;
        $this->articleLogic = $articleLogic;
        $this->authorLogic = $authorLogic;
        $this->searchLogic = $searchLogic;
        $this->bookLogic = $bookLogic;
    }

    public function home()
    {
        return self::httpResp($this->homeLogic->info());
    }

    public function article()
    {
        return self::httpResp($this->articleLogic->info());
    }

    public function author()
    {
        return self::httpResp($this->authorLogic->info());
    }

    public function search()
    {
        return self::httpResp($this->searchLogic->info());
    }

    public function book()
    {
        return self::httpResp($this->bookLogic->info());
    }
}
